<template>
  <div>
    <NavType />
    <List />
    <Recommend />
    <Rank />
    <Like />
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor" />
    <Brand />
  </div>
</template>

<script>
import List from "@pages/Home/List";
import Brand from "@pages/Home/Brand";
import Rank from "@pages/Home/Rank";
import Like from "@pages/Home/Like";
import Floor from "@pages/Home/Floor";
import Recommend from "@pages/Home/Recommend";
import { requestFloorList } from "@/api";
export default {
  name: "Home",
  components: { List, Brand, Rank, Like, Floor, Recommend },
  data() {
    return {
      floorList: [],
    };
  },
  // 开始的时候调用这个函数 请求数据
  mounted() {
    this.getFloor();
  },
  methods: {
    async getFloor() {
      const res = await requestFloorList();
      this.floorList = res;
    },
  },
};
</script>

<style>
</style>